-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Workspace]Deny get or bulkGet for global data source #8043
[Workspace]Deny get or bulkGet for global data source #8043
Conversation
Signed-off-by: Lin Wang <wonglam@amazon.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8043 +/- ##
==========================================
- Coverage 60.60% 60.59% -0.02%
==========================================
Files 3732 3732
Lines 88427 88431 +4
Branches 13701 13702 +1
==========================================
- Hits 53589 53581 -8
- Misses 31579 31591 +12
Partials 3259 3259
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
* Deny get or bulkGet for global data source Signed-off-by: Lin Wang <wonglam@amazon.com> * Changeset file for PR #8043 created/updated --------- Signed-off-by: Lin Wang <wonglam@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit d22b68b) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.17 2.17
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.17
# Create a new branch
git switch --create backport/backport-8043-to-2.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d22b68b3ea439fd97e0ed8363fb9fb79c1f89dd6
# Push it to GitHub
git push --set-upstream origin backport/backport-8043-to-2.17
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.17 Then, create a pull request where the |
* Deny get or bulkGet for global data source * Changeset file for PR #8043 created/updated --------- (cherry picked from commit d22b68b) Signed-off-by: Lin Wang <wonglam@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
* Deny get or bulkGet for global data source * Changeset file for PR #8043 created/updated --------- (cherry picked from commit d22b68b) Signed-off-by: Lin Wang <wonglam@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 27cce8e) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…#8056) * Deny get or bulkGet for global data source * Changeset file for PR #8043 created/updated --------- (cherry picked from commit d22b68b) (cherry picked from commit 27cce8e) Signed-off-by: Lin Wang <wonglam@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
This PR is for adding permission validation in saved objects client's
get
orbulkGet
methods. Currently, a user can callget
/bulkGet
with data source id for global data source (not assigned to any workspace). These two methods will throw error when operating on these global data sources.Issues Resolved
#8044
Screenshot
No UI changes
Testing the changes
yarn osd bootstrap --single-version ignore
config/opensearch_dashboards.yml
yarn start --no-base-path
test-user
withkibanauser
backend rolesThese two commands should response
{"statusCode":403,"error":"Forbidden","message":"Invalid data source permission, please associate it to current workspace"}
Changelog
Check List
yarn test:jest
yarn test:jest_integration